package com.heu.blood.storge.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.heu.blood.storge.entity.BloodOutStorgeEntity;
import com.heu.blood.storge.vo.BloodOutStorgeEntityVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 
 * 
 * @author lyj
 * @email lyj@heu.com
 * @date 2023-06-16 00:33:53
 */
@Mapper
public interface BloodOutStorgeDao extends BaseMapper<BloodOutStorgeEntity> {

    //@Param("ew") Wrapper<BloodOutStorgeEntityVo> wrapper
    @Select(" select o.*,u.blood_bank_delivery_id,u.out_storge_reason,u.out_storge_time,u.out_storge_location,u.recipient_name,u.recipient_id,u.operator_name,u.operator_id,u.id as NewOutStorgeId\n" +
            "               from blood_out_storge as u left join blood_information as o on u.blood_id =o.blood_id ${ew.customSqlSegment}")
    IPage<BloodOutStorgeEntityVo> queryPageMultipleTable(IPage<BloodOutStorgeEntityVo> page, @Param(Constants.WRAPPER) QueryWrapper<BloodOutStorgeEntityVo> queryWrapper);
}
